import * as zrender from "zrender";

class Descript {
  constructor(node) {
    this.node = node;
    this.drawText();
  }

  drawText() {
    const { shape, style, position } = this.node;
    const [x, y] = position;

    const descript = new zrender.Text({
      style: {
        text: "this.node.data.descript",
        textFill: "#000",
        fontSize: 12,
        textVerticalAlign: "top",
        textPadding: [0, 0, 0, 0],
        ...style,
        x: x + shape.width / 2,
        y: y + shape.height + 10,
      },
    });

    descript.mark = "descript";
    this.text = descript;
  }
}

export default Descript;
